/**
 * Vuex状态管理
 */
import { createStore } from 'vuex'
import mutations from './mutations'
import storage from './../utils/storage'
import api from "../api/index.js"

const state = {
    noticeCount:0,
    userInfo: storage.getItem("userInfo") || {}, // 获取用户信息
    menuList: storage.getItem("menuList") || [],
    actionList: storage.getItem("actionList") || [],
}
const actions={
    async noticeCountGet({commit}){
        const res = await api.noticeCount()
        commit("noticeCountGet",res)
    }
}
export default createStore({
    state,
    mutations,
    actions
})